/**
 @file ctc_acl_frz.h

 @date 2020-04-27

 @version v5.6.0.18

 The file define api struct used in ACL.
*/

#ifndef _CTC_ACL_FREEZE_H_
#define _CTC_ACL_FREEZE_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "common/include/ctc_const.h"
#include "common/include/ctc_field.h"


/**
@brief  Mac key field flag
*/
enum ctc_acl_mac_key_flag_e
{
    CTC_ACL_MAC_KEY_FLAG_MAC_DA      = 1U << 0,  /**< [GB.GG.D2.TM] Valid MAC-DA in MAC key */
    CTC_ACL_MAC_KEY_FLAG_MAC_SA      = 1U << 1,  /**< [GB.GG.D2.TM] Valid MAC-SA in MAC key */
    CTC_ACL_MAC_KEY_FLAG_CVLAN       = 1U << 3,  /**< [GB.GG.D2.TM] Valid C-VLAN in MAC key */
    CTC_ACL_MAC_KEY_FLAG_CTAG_COS    = 1U << 4,  /**< [GB.GG.D2.TM] Valid C-tag CoS in MAC key */
    CTC_ACL_MAC_KEY_FLAG_SVLAN       = 1U << 5,  /**< [GB.GG.D2.TM] Valid S-VLAN in MAC key */
    CTC_ACL_MAC_KEY_FLAG_STAG_COS    = 1U << 6,  /**< [GB.GG.D2.TM] Valid S-tag CoS in MAC key */
    CTC_ACL_MAC_KEY_FLAG_ETH_TYPE    = 1U << 7,  /**< [GB.GG.D2.TM] Valid eth-type in MAC key */
    CTC_ACL_MAC_KEY_FLAG_L2_TYPE     = 1U << 8,  /**< [GB.D2.TM] Valid l2-type in MAC key */
    CTC_ACL_MAC_KEY_FLAG_L3_TYPE     = 1U << 9,  /**< [GB.GG] Valid l3-type in MAC key */
    CTC_ACL_MAC_KEY_FLAG_CTAG_CFI    = 1U << 10, /**< [GB.GG.D2.TM] Valid l2-type in MAC key */
    CTC_ACL_MAC_KEY_FLAG_STAG_CFI    = 1U << 11, /**< [GB.GG.D2.TM] Valid l3-type in MAC key */
    CTC_ACL_MAC_KEY_FLAG_ARP_OP_CODE = 1U << 12, /**< [GB] Valid Arp-op-code in MAC key */
    CTC_ACL_MAC_KEY_FLAG_IP_SA       = 1U << 13, /**< [GB] Valid Ip-sa in MAC key */
    CTC_ACL_MAC_KEY_FLAG_IP_DA       = 1U << 14, /**< [GB] Valid Ip-da in MAC key */
    CTC_ACL_MAC_KEY_FLAG_STAG_VALID  = 1U << 15, /**< [GB.GG.D2.TM] Valid stag-valid in MAC key */
    CTC_ACL_MAC_KEY_FLAG_CTAG_VALID  = 1U << 16, /**< [GB.GG.D2.TM] Valid ctag-valid in MAC key */
    CTC_ACL_MAC_KEY_FLAG_VLAN_NUM    = 1U << 17, /**< [GG.D2.TM] Valid vlan number in MAC key */
    CTC_ACL_MAC_KEY_FLAG_METADATA    = 1U << 18  /**< [GG.D2.TM] Valid metadata in MAC key */
};
typedef enum ctc_acl_mac_key_flag_e ctc_acl_mac_key_flag_t;

/**
@brief  acl hash mac key flag
*/
enum ctc_acl_hash_mac_key_flag_e
{
    CTC_ACL_HASH_MAC_KEY_FLAG_MAC_DA           = 1U << 0, /**< [GB] MAC DA as ACL HASH MAC KEY member*/
    CTC_ACL_HASH_MAC_KEY_FLAG_ETH_TYPE         = 1U << 1, /**< [GB] ETHER TYPE as ACL HASH MAC KEY member*/
    CTC_ACL_HASH_MAC_KEY_FLAG_PHY_PORT         = 1U << 2, /**< [GB] PHY PORT as ACL HASH MAC KEY member*/
    CTC_ACL_HASH_MAC_KEY_FLAG_LOGIC_PORT       = 1U << 3, /**< [GB] LOGIC PORT as ACL HASH MAC KEY member*/
    CTC_ACL_HASH_MAC_KEY_FLAG_COS              = 1U << 4, /**< [GB] COS as ACL HASH MAC KEY member*/
    CTC_ACL_HASH_MAC_KEY_FLAG_VLAN_ID          = 1U << 5, /**< [GB] VLAN ID as ACL HASH MAC KEY member*/
    CTC_ACL_HASH_MAC_KEY_FLAG_MAX              = 1U << 6
};
typedef enum ctc_acl_hash_mac_key_flag_e ctc_acl_hash_mac_key_flag_t;

/**
@brief Define ACl Mac Key structure
*/
struct ctc_acl_mac_key_s
{
    uint32 flag;                /**< [GB.GG.D2.TM] Bitmap of ctc_acl_mac_key_flag_t */

    mac_addr_t mac_da;          /**< [GB.GG.D2.TM] MAC-DA */
    mac_addr_t mac_da_mask;     /**< [GB.GG.D2.TM] MAC-DA mask */
    mac_addr_t mac_sa;          /**< [GB.GG.D2.TM] MAC-SA */
    mac_addr_t mac_sa_mask;     /**< [GB.GG.D2.TM] MAC-SA mask */

    uint16 cvlan;               /**< [GB.GG.D2.TM] C-VLAN */
    uint16 cvlan_mask;          /**< [GB.GG.D2.TM] C-VLAN mask*/
    uint16 svlan;               /**< [GB.GG.D2.TM] S-VLAN */
    uint16 svlan_mask;          /**< [GB.GG.D2.TM] S-VLAN mask*/

    uint8  vrange_grpid;        /**< [GG.D2.TM] vlan range group id: 0~63 used in vlan range check*/
    uint16 cvlan_end;           /**< [GG.D2.TM] orignal max cvlan id need to do vlan range acl*/
    uint16 svlan_end;           /**< [GG.D2.TM] orignal max svlan id need to do vlan range acl*/

    uint8  ctag_cos;            /**< [GB.GG.D2.TM] C-tag CoS */
    uint8  ctag_cos_mask;       /**< [GB.GG.D2.TM] C-tag CoS mask*/
    uint8  ctag_cfi;            /**< [GB.GG.D2.TM] C-tag CFI */
    uint8  stag_cos;            /**< [GB.GG.D2.TM] S-tag CoS */
    uint8  stag_cos_mask;       /**< [GB.GG.D2.TM] S-tag CoS mask*/
    uint8  stag_cfi;            /**< [GB.GG.D2.TM] S-tag CFI */

    uint8  l2_type;             /**< [GB.D2.TM] Layer 2 type. Refer to ctc_parser_l2_type_t */
    uint8  l2_type_mask;        /**< [GB.D2.TM] Layer 2 type mask*/
    uint8  l3_type;             /**< [GB.GG] Layer 3 type. Refer to ctc_parser_l3_type_t */
    uint8  l3_type_mask;        /**< [GB.GG] Layer 3 type mask*/
    uint16 eth_type;            /**< [GB.GG.D2.TM] Ethernet type, for unknow or flexible L3 type in GG */
    uint16 eth_type_mask;       /**< [GB.GG.D2.TM] Ethernet type mask*/


    uint16 arp_op_code;         /**< [GB] Arp op code*/
    uint16 arp_op_code_mask;    /**< [GB] Arp op code mask*/
    uint32 ip_sa;               /**< [GB] Ip source address */
    uint32 ip_sa_mask;          /**< [GB] Ip source address mask */
    uint32 ip_da;               /**< [GB] Ip destination address */
    uint32 ip_da_mask;          /**< [GB] Ip destination address mask*/
    uint8  stag_valid;          /**< [GB.GG.D2.TM] Stag valid */
    uint8  ctag_valid;          /**< [GB.GG.D2.TM] Ctag valid */

    uint32 metadata;            /**< [GG.D2.TM] metadata */
    uint32 metadata_mask;       /**< [GG.D2.TM] metadata mask*/

    uint8 vlan_num;             /**< [GG.D2.TM] vlan number */
    uint8 vlan_num_mask;        /**< [GG.D2.TM] vlan number mask */

    ctc_field_port_t port;      /**< [GB.GG.D2.TM] valid when group type CTC_ACL_GROUP_TYPE_NONE, refer to struct ctc_field_port_t */
    ctc_field_port_t port_mask;     /**< [GG.D2.TM] valid when group type CTC_ACL_GROUP_TYPE_NONE, refer to struct ctc_field_port_t */
};
typedef struct ctc_acl_mac_key_s  ctc_acl_mac_key_t;

/**
@brief  Acl Mpls Key Flag
*/
enum ctc_acl_mpls_key_flag_e
{
    CTC_ACL_MPLS_KEY_FLAG_MAC_DA        = 1U << 0,   /**< [GB.GG.D2.TM] Valid MAC-DA in MPLS key */
    CTC_ACL_MPLS_KEY_FLAG_MAC_SA        = 1U << 1,   /**< [GB.GG.D2.TM] Valid MAC-SA in MPLS key */
    CTC_ACL_MPLS_KEY_FLAG_CVLAN         = 1U << 3,   /**< [GB.GG.D2.TM] Valid C-VLAN in MPLS key */
    CTC_ACL_MPLS_KEY_FLAG_CTAG_COS      = 1U << 4,   /**< [GB.GG.D2.TM] Valid C-tag CoS in MPLS key */
    CTC_ACL_MPLS_KEY_FLAG_SVLAN         = 1U << 5,   /**< [GB.GG.D2.TM] Valid S-VLAN in MPLS key */
    CTC_ACL_MPLS_KEY_FLAG_STAG_COS      = 1U << 6,   /**< [GB.GG.D2.TM] Valid S-tag CoS in MPLS key */
    CTC_ACL_MPLS_KEY_FLAG_MPLS_LABEL0   = 1U << 8,   /**< [GB.GG.D2.TM] Valid MPLS label 0 in MPLS key */
    CTC_ACL_MPLS_KEY_FLAG_MPLS_LABEL1   = 1U << 9,   /**< [GB.GG.D2.TM] Valid MPLS label 1 in MPLS key */
    CTC_ACL_MPLS_KEY_FLAG_MPLS_LABEL2   = 1U << 10,  /**< [GB.GG.D2.TM] Valid MPLS label 2 in MPLS key */
    CTC_ACL_MPLS_KEY_FLAG_MPLS_LABEL3   = 1U << 11,  /**< [GB] Valid MPLS label 3 in MPLS key */
    CTC_ACL_MPLS_KEY_FLAG_ROUTED_PACKET = 1U << 12,  /**< [GB.GG.D2.TM] Valid Routed-packet in MPLS key */
    CTC_ACL_MPLS_KEY_FLAG_CTAG_CFI      = 1U << 13,  /**< [GB.D2.TM] Valid C-tag CoS in MPLS key */
    CTC_ACL_MPLS_KEY_FLAG_STAG_CFI      = 1U << 14,  /**< [GB.GG.D2.TM] Valid S-tag CoS in MPLS key */
    CTC_ACL_MPLS_KEY_FLAG_METADATA      = 1U << 15,  /**< [GG.D2.TM] Valid metadata in MPLS key */
    CTC_ACL_MPLS_KEY_FLAG_MPLS_LABEL_NUM = 1U << 16  /**< [GG.D2.TM] MPLS label number field*/
};
typedef enum ctc_acl_mpls_key_flag_e ctc_acl_mpls_key_flag_t;

/**
@brief Define ACl Mpls Key structure
*/
struct ctc_acl_mpls_key_s
{
    uint32 flag;                /**< [GB.GG.D2.TM] Bitmap of CTC_ACL_MPLS_KEY_FLAG_XXX */

    mac_addr_t mac_da;          /**< [GB.GG.D2.TM] MAC-DA */
    mac_addr_t mac_da_mask;     /**< [GB.GG.D2.TM] MAC-DA mask */
    mac_addr_t mac_sa;          /**< [GB.GG.D2.TM] MAC-SA */
    mac_addr_t mac_sa_mask;     /**< [GB.GG.D2.TM] MAC-SA mask */

    uint16 cvlan;               /**< [GB.GG.D2.TM] C-VLAN tag */
    uint16 cvlan_mask;          /**< [GB.GG.D2.TM] C-VLAN mask*/
    uint16 svlan;               /**< [GB.GG.D2.TM] S-VLAN tag */
    uint16 svlan_mask;          /**< [GB.GG.D2.TM] S-VLAN mask*/

    uint8  vrange_grpid;        /**< [GG.D2.TM] vlan range group id: 0~63 used in vlan range check*/
    uint16 cvlan_end;           /**< [GG.D2.TM] orignal max cvlan id need to do vlan range acl*/
    uint16 svlan_end;           /**< [GG.D2.TM] orignal max svlan id need to do vlan range acl*/

    uint8  ctag_cos;            /**< [GB.GG.D2.TM] C-tag CoS */
    uint8  ctag_cos_mask;       /**< [GB.GG.D2.TM] C-tag CoS mask */
    uint8  stag_cos;            /**< [GB.GG.D2.TM] S-tag Cos */
    uint8  stag_cos_mask;       /**< [GB.GG.D2.TM] S-tag Cos mask */

    uint8  ctag_cfi;            /**< [GB.GG.D2.TM] C-tag Cfi */
    uint8  stag_cfi;            /**< [GB.GG.D2.TM] S-tag Cfi */
    uint8  routed_packet;       /**< [GB.GG.D2.TM] Routed packet */
    uint8  rsv0;


    uint32 mpls_label0;         /**< [GB.GG.D2.TM] MPLS label 0, include: Label + Exp + S + TTL */
    uint32 mpls_label0_mask;    /**< [GB.GG.D2.TM] MPLS label 0 mask*/
    uint32 mpls_label1;         /**< [GB.GG.D2.TM] MPLS label 1, include: Label + Exp + S + TTL */
    uint32 mpls_label1_mask;    /**< [GB.GG.D2.TM] MPLS label 1 mask*/
    uint32 mpls_label2;         /**< [GB.GG.D2.TM] MPLS label 2, include: Label + Exp + S + TTL */
    uint32 mpls_label2_mask;    /**< [GB.GG.D2.TM] MPLS label 2 mask*/
    uint32 mpls_label3;         /**< [GB] MPLS label 3, include: Label + Exp + S + TTL */
    uint32 mpls_label3_mask;    /**< [GB] MPLS label 3 mask*/

    uint8  mpls_label_num;      /**< [GG.D2.TM] MPLS label number*/
    uint8  mpls_label_num_mask; /**< [GG.D2.TM] MPLS label number mask*/

    uint32 metadata;            /**< [GG.D2.TM] Metadata */
    uint32 metadata_mask;       /**< [GG.D2.TM] Metadata mask*/

    ctc_field_port_t port;      /**< [GB.GG.D2.TM] valid when group type CTC_ACL_GROUP_TYPE_NONE, refer to struct ctc_field_port_t */
    ctc_field_port_t port_mask;     /**< [GG.D2.TM] valid when group type CTC_ACL_GROUP_TYPE_NONE, refer to struct ctc_field_port_t */

};
typedef struct ctc_acl_mpls_key_s  ctc_acl_mpls_key_t;

/**
@brief  Ipv4 key field flag
*/
enum ctc_acl_ipv4_key_flag_e
{

    CTC_ACL_IPV4_KEY_FLAG_MAC_DA        = 1U << 0,  /**< [GB.GG.D2.TM] Valid MAC-DA in IPv4 key */
    CTC_ACL_IPV4_KEY_FLAG_MAC_SA        = 1U << 1,  /**< [GB.GG.D2.TM] Valid MAC-SA in IPv4 key */
    CTC_ACL_IPV4_KEY_FLAG_CVLAN         = 1U << 3,  /**< [GB.GG.D2.TM] Valid C-VLAN in IPv4 key */
    CTC_ACL_IPV4_KEY_FLAG_CTAG_COS      = 1U << 4,  /**< [GB.GG.D2.TM] Valid C-tag CoS in IPv4 key */
    CTC_ACL_IPV4_KEY_FLAG_SVLAN         = 1U << 5,  /**< [GB.GG.D2.TM] Valid S-VLAN in IPv4 key */
    CTC_ACL_IPV4_KEY_FLAG_STAG_COS      = 1U << 6,  /**< [GB.GG.D2.TM] Valid S-tag CoS in IPv4 key */
    CTC_ACL_IPV4_KEY_FLAG_L2_TYPE       = 1U << 7,  /**< [GB] Valid l2-type in IPv4 key, NOTE: Limited support on GB, When merge key,
                                                                    collision with FLAG_DSCP/FLAG_PRECEDENCE, And ineffective for ipv4_packet*/
    CTC_ACL_IPV4_KEY_FLAG_L3_TYPE       = 1U << 8,  /**< [GG.D2.TM] Valid l3-type in IPv4 key */
    CTC_ACL_IPV4_KEY_FLAG_IP_SA         = 1U << 9,  /**< [GB.GG.D2.TM] Valid IP-SA in IPv4 key */
    CTC_ACL_IPV4_KEY_FLAG_IP_DA         = 1U << 10, /**< [GB.GG.D2.TM] Valid IP-DA in IPv4 key */
    CTC_ACL_IPV4_KEY_FLAG_L4_PROTOCOL   = 1U << 11, /**< [GB.GG.D2.TM] Valid L4-Proto in IPv4 key */
    CTC_ACL_IPV4_KEY_FLAG_DSCP          = 1U << 12, /**< [GB.GG.D2.TM] Valid DSCP in IPv4 key */
    CTC_ACL_IPV4_KEY_FLAG_PRECEDENCE    = 1U << 13, /**< [GB.GG.D2.TM] Valid IP Precedence in IPv4 key */
    CTC_ACL_IPV4_KEY_FLAG_IP_FRAG       = 1U << 14, /**< [GB.GG.D2.TM] Valid fragment in IPv4 key */
    CTC_ACL_IPV4_KEY_FLAG_IP_OPTION     = 1U << 15, /**< [GB.GG.D2.TM] Valid IP option in IPv4 key */
    CTC_ACL_IPV4_KEY_FLAG_ROUTED_PACKET = 1U << 16, /**< [GB.GG.D2.TM] Valid routed packet in IPv4 key */
    CTC_ACL_IPV4_KEY_FLAG_CTAG_CFI      = 1U << 17, /**< [GB] Valid C-tag cfi in IPv4 key */
    CTC_ACL_IPV4_KEY_FLAG_STAG_CFI      = 1U << 18, /**< [GB.GG.D2.TM] Valid S-tag cfi in IPv4 key */
    CTC_ACL_IPV4_KEY_FLAG_STAG_VALID    = 1U << 19, /**< [GB.GG.D2.TM] Valid Stag-valid in IPv4 key */
    CTC_ACL_IPV4_KEY_FLAG_CTAG_VALID    = 1U << 20, /**< [GB.GG.D2.TM] Valid Ctag-valid in IPv4 key */
    CTC_ACL_IPV4_KEY_FLAG_ETH_TYPE      = 1U << 22, /**< [GB.GG.D2.TM] Valid Ether type in IPv4 Key, NOTE:  (GB) Used when merge key, collision with L4_DST_PORT,
                                                                    Do NOT set this flag on Egress ACL. And If required matching ipv4 packet,
                                                                    Do NOT set this flag with set ether_type = 0x0800, Set CTC_ACL_IPV4_KEY_FLAG_IPV4_PACKET instead */
    CTC_ACL_IPV4_KEY_FLAG_IPV4_PACKET   = 1U << 23, /**< [GB] Valid Ipv4 packet in IPv4 Key, NOTE: (GB) used when merge key, For non-merge, Ipv4 key only for ipv4/arp packet*/
    CTC_ACL_IPV4_KEY_FLAG_ARP_PACKET    = 1U << 24, /**< [GB] Valid Arp packet in IPv4 Key, NOTE: (GB) used when merge key, For non-merge, Ipv4 key only for ipv4/arp packet*/
    CTC_ACL_IPV4_KEY_FLAG_ECN           = 1U << 25, /**< [GG.D2.TM] Valid Ecn in IPv4 Key*/
    CTC_ACL_IPV4_KEY_FLAG_METADATA      = 1U << 26,  /**< [GG.D2.TM] Valid metadata in ipv4 key */
    CTC_ACL_IPV4_KEY_FLAG_UDF           = 1U << 27,  /**< [GG.D2.TM] Valid udf in ipv4 key */
    CTC_ACL_IPV4_KEY_FLAG_VLAN_NUM      = 1U << 28,  /**< [GG.D2.TM] Valid vlan number in ipv4 key */
    CTC_ACL_IPV4_KEY_FLAG_PKT_LEN_RANGE = 1U << 29,  /**< [GG.D2.TM] Valid packet length range in ipv4 key */
    CTC_ACL_IPV4_KEY_FLAG_IP_HDR_ERROR  = 1U << 30   /**< [GG.D2.TM] Valid ip header error in ipv4 key */
};
typedef enum ctc_acl_ipv4_key_flag_e ctc_acl_ipv4_key_flag_t;

/**
@brief  Ipv4 key sub field flag
*/
enum ctc_acl_ipv4_key_sub_flag_e
{
    CTC_ACL_IPV4_KEY_SUB_FLAG_L4_SRC_PORT       = 1U << 0, /**< [GB.GG.D2.TM] Depend on L4_PROTOCOL = TCP|UDP, Valid L4 source port in IPv4 key */
    CTC_ACL_IPV4_KEY_SUB_FLAG_L4_DST_PORT       = 1U << 1, /**< [GB.GG.D2.TM] Depend on L4_PROTOCOL = TCP|UDP, Valid L4 destination port in IPv4 key */
    CTC_ACL_IPV4_KEY_SUB_FLAG_TCP_FLAGS         = 1U << 2, /**< [GB.GG.D2.TM] Depend on L4_PROTOCOL = TCP, Valid TCP flag in IPv4 key */
    CTC_ACL_IPV4_KEY_SUB_FLAG_ICMP_TYPE         = 1U << 3, /**< [GB.GG.D2.TM] Depend on L4_PROTOCOL = ICMP, Valid ICMP type in IPv4 key */
    CTC_ACL_IPV4_KEY_SUB_FLAG_ICMP_CODE         = 1U << 4, /**< [GB.GG.D2.TM] Depend on L4_PROTOCOL = ICMP, Valid ICMP code in IPv4 key */
    CTC_ACL_IPV4_KEY_SUB_FLAG_IGMP_TYPE         = 1U << 5, /**< [GB.GG.D2.TM] Depend on L4_PROTOCOL = IGMP, Valid IGMP type in IPv4 key */
    CTC_ACL_IPV4_KEY_SUB_FLAG_ARP_OP_CODE       = 1U << 6, /**< [GB.GG.D2.TM] (GB)Depend on ARP_PACKET, (GG)Depend on L3_TYPE,Valid Arp op code in Arp Key */
    CTC_ACL_IPV4_KEY_SUB_FLAG_ARP_SENDER_IP     = 1U << 7, /**< [GB.GG.D2.TM] (GB)Depend on ARP_PACKET, (GG)Depend on L3_TYPE,Valid Arp sender Ip in Arp Key */
    CTC_ACL_IPV4_KEY_SUB_FLAG_ARP_TARGET_IP     = 1U << 8, /**< [GB.GG.D2.TM] (GB)Depend on ARP_PACKET, (GG)Depend on L3_TYPE,Valid Arp target Ip in Arp Key */
    CTC_ACL_IPV4_KEY_SUB_FLAG_ARP_PROTOCOL_TYPE = 1U << 9, /**< [GG.D2.TM] (GB)Depend on ARP_PACKET, (GG)Depend on L3_TYPE,Valid Arp target Ip in Arp Key */
    CTC_ACL_IPV4_KEY_SUB_FLAG_GRE_KEY           = 1U << 10,/**< [GG.D2.TM] Depend on L4_PROTOCOL = GRE, Valid GRE key in IPv4 key */
    CTC_ACL_IPV4_KEY_SUB_FLAG_VNI               = 1U << 11,/**< [GG.D2.TM] Depend on L4_PROTOCOL = UDP, Valid vni in IPv4 key */
    CTC_ACL_IPV4_KEY_SUB_FLAG_NVGRE_KEY         = 1U << 12,/**< [GG.D2.TM] Depend on L4_PROTOCOL = NVGRE, Valid NVGRE key in IPv4 key */
    CTC_ACL_IPV4_KEY_SUB_FLAG_GRE_CRKS          = 1U << 13 /**< [GG] Depend on L4_PROTOCOL = GRE, valid C R K S 4 bits in GRE header in IPv4 key */
};
typedef enum ctc_acl_ipv4_key_sub_flag_e ctc_acl_ipv4_key_sub_flag_t;

/**
@brief  Ipv4 key sub1 field flag
*/
enum ctc_acl_ipv4_key_sub1_flag_e
{

    CTC_ACL_IPV4_KEY_SUB1_FLAG_MPLS_LABEL_NUM = 1U << 0,            /**< [GG.D2.TM] MPLS label number field*/
    CTC_ACL_IPV4_KEY_SUB1_FLAG_MPLS_LABEL0    = 1U << 1,            /**< [GG.D2.TM] MPLS label 0 as key field*/
    CTC_ACL_IPV4_KEY_SUB1_FLAG_MPLS_LABEL1    = 1U << 2,            /**< [GG.D2.TM] MPLS label 1 as key field*/
    CTC_ACL_IPV4_KEY_SUB1_FLAG_MPLS_LABEL2    = 1U << 3             /**< [GG.D2.TM] MPLS label 2 as key field*/
};
typedef enum ctc_acl_ipv4_key_sub1_flag_e ctc_acl_ipv4_key_sub1_flag_t;

/**
@brief  Ipv4 key sub3 field flag
*/
enum ctc_acl_ipv4_key_sub3_flag_e
{
    CTC_ACL_IPV4_KEY_SUB3_FLAG_ETHOAM_LEVEL = 1U << 0,      /**< [GB.GG.D2.TM] Ether oam level as key field*/
    CTC_ACL_IPV4_KEY_SUB3_FLAG_ETHOAM_OPCODE = 1U << 1      /**< [GB.GG.D2.TM] Ether oam opcode as key field*/
};
typedef enum ctc_acl_ipv4_key_sub3_flag_e ctc_acl_ipv4_key_sub3_flag_t;

/**
@brief Define ACl IPv4 Key structure
*/
struct ctc_acl_ipv4_key_s
{
    uint32 flag;                            /**< [GB.GG.D2.TM] Bitmap of CTC_ACL_IPV4_KEY_FLAG_XXX */
    uint32 sub_flag;                        /**< [GB.GG.D2.TM] Bitmap of CTC_ACL_IPV4_KEY_SUB_FLAG_XXX */
    uint32 sub1_flag;                       /**< [GG.D2.TM] Bitmap of CTC_ACL_IPV4_KEY_SUB1_FLAG_XXX */
    uint32 sub2_flag;                       /**< [GG.D2.TM] Bitmap of CTC_ACL_IPV4_KEY_SUB2_FLAG_XXX */
    uint32 sub3_flag;                       /**< [GB.GG.D2.TM] Bitmap of CTC_ACL_IPV4_KEY_SUB3_FLAG_XXX */
    uint8  key_size;                        /**< [GG.D2.TM] Key Size */

    uint32 ip_sa;                           /**< [GB.GG.D2.TM] IP-SA */
    uint32 ip_sa_mask;                      /**< [GB.GG.D2.TM] IP-SA mask */
    uint32 ip_da;                           /**< [GB.GG.D2.TM] IP-DA */
    uint32 ip_da_mask;                      /**< [GB.GG.D2.TM] IP-DA mask */

    uint16 l4_src_port_0;                   /**< [GB.GG.D2.TM] Layer 4 source port,Min/Data */
    uint16 l4_src_port_1;                   /**< [GB.GG.D2.TM] Layer 4 source port,Max/Mask */

    uint8  l4_src_port_use_mask;            /**< [GB.GG.D2.TM] Use mask instead of range*/
    uint8  l4_dst_port_use_mask;            /**< [GB.GG.D2.TM] Use mask instead of range*/
    uint8  ip_option;                       /**< [GB.GG.D2.TM] Ip option */
    uint8  routed_packet;                   /**< [GB.GG.D2.TM] Routed packet */

    uint16 l4_dst_port_0;                   /**< [GB.GG.D2.TM] Layer 4 dest port */
    uint16 l4_dst_port_1;                   /**< [GB.GG.D2.TM] Layer 4 dest port */

    uint32 pkt_len_min;                     /**< [GG.D2.TM] Packet length Min */
    uint32 pkt_len_max;                     /**< [GG.D2.TM] Packet Length Max */

    uint8  tcp_flags_match_any;             /**< [GB.GG.D2.TM] 0:match all. 1:match any*/
    uint8  tcp_flags;                       /**< [GB.GG.D2.TM] Tcp flag bitmap*/
    uint8  dscp;                            /**< [GB.GG.D2.TM] DSCP */
    uint8  dscp_mask;                       /**< [GB.GG.D2.TM] DSCP mask*/

    uint8  l4_protocol;                     /**< [GB.GG.D2.TM] Layer 4 protocol */
    uint8  l4_protocol_mask;                /**< [GB.GG.D2.TM] Layer 4 protocol mask, for gg if protocol is TCP/UDP/GRE, the mask must be 0xff*/
    uint8  igmp_type;                       /**< [GB.GG.D2.TM] IGMP type */
    uint8  igmp_type_mask;                  /**< [GB.GG.D2.TM] IGMP type mask*/

    uint8  icmp_type;                       /**< [GB.GG.D2.TM] ICMP type */
    uint8  icmp_type_mask;                  /**< [GB.GG.D2.TM] ICMP type mask*/
    uint8  icmp_code;                       /**< [GB.GG.D2.TM] ICMP code */
    uint8  icmp_code_mask;                  /**< [GB.GG.D2.TM] ICMP code mask*/

    uint8  ip_frag;                         /**< [GB.GG.D2.TM] Ip fragment, CTC_IP_FRAG_XXX */
    uint8  ip_hdr_error;                 /**< [GG.D2.TM] ip header error packet */
    uint8  rsv0[2];

    mac_addr_t mac_sa;                      /**< [GB.GG.D2.TM] MAC-SA */
    mac_addr_t mac_sa_mask;                 /**< [GB.GG.D2.TM] MAC-SA mask */
    mac_addr_t mac_da;                      /**< [GB.GG.D2.TM] MAC-DA */
    mac_addr_t mac_da_mask;                 /**< [GB.GG.D2.TM] MAC-DA mask */

    uint16 cvlan;                           /**< [GB.GG.D2.TM] C-VLAN */
    uint16 cvlan_mask;                      /**< [GB.GG.D2.TM] C-VLAN mask*/
    uint16 svlan;                           /**< [GB.GG.D2.TM] S-VLAN */
    uint16 svlan_mask;                      /**< [GB.GG.D2.TM] S-VLAN mask*/

    uint8  vrange_grpid;                    /**< [GG.D2.TM] vlan range group id: 0~63 used in vlan range check*/
    uint16 cvlan_end;                       /**< [GG.D2.TM] orignal max cvlan id need to do vlan range acl*/
    uint16 svlan_end;                       /**< [GG.D2.TM] orignal max svlan id need to do vlan range acl*/

    uint8  ctag_cos;                        /**< [GB.GG.D2.TM] C-tag CoS */
    uint8  ctag_cos_mask;                   /**< [GB.GG.D2.TM] C-tag CoS mask*/
    uint8  stag_cos;                        /**< [GB.GG.D2.TM] S-tag CoS */
    uint8  stag_cos_mask;                   /**< [GB.GG.D2.TM] S-tag CoS mask*/

    uint8  ctag_cfi;                        /**< [GB.GG.D2.TM] C-tag CFI */
    uint8  stag_cfi;                        /**< [GB.GG.D2.TM] S-tag CFI */
    uint8  l2_type;                         /**< [GB.D2.TM] Layer 2 type, Refer to ctc_parser_l2_type_t */
    uint8  l2_type_mask;                    /**< [GB.D2.TM] Layer 2 type */

    uint8  l3_type;                         /**< [GG.D2.TM] Layer 3 type, Refer to ctc_parser_l3_type_t */
    uint8  l3_type_mask;                    /**< [GG.D2.TM] Layer 3 type mask, when care Layer 3 type should set 0xF */

    uint16 eth_type;                        /**< [GB.GG.D2.TM] Ethernet type */
    uint16 eth_type_mask;                   /**< [GB.GG.D2.TM] Ethernet type mask*/

    uint16 arp_op_code;                     /**< [GB.GG.D2.TM] Arp op code*/
    uint16 arp_op_code_mask;                /**< [GB.GG.D2.TM] Arp op code mask*/

    uint32 sender_ip;                       /**< [GB.GG.D2.TM] Sender ip */
    uint32 sender_ip_mask;                  /**< [GB.GG.D2.TM] Sender ip mask */
    uint32 target_ip;                       /**< [GB.GG.D2.TM] Target ip */
    uint32 target_ip_mask;                  /**< [GB.GG.D2.TM] Target ip mask */

    uint8  stag_valid;                      /**< [GB.GG.D2.TM] Stag valid */
    uint8  ctag_valid;                      /**< [GB.GG.D2.TM] Ctag valid */
    uint8  ipv4_packet;                     /**< [GB] Ipv4 packet */
    uint8  arp_packet;                      /**< [GB] Arp packet */

    uint8  ecn;                             /**< [GG.D2.TM] ecn*/
    uint8  ecn_mask;                        /**< [GG.D2.TM] ecn mask*/

    uint16 arp_protocol_type;               /**< [GG.D2.TM] arp protocol type*/
    uint16 arp_protocol_type_mask;          /**< [GG.D2.TM] arp protocol type mask*/

    uint32 mpls_label0;                     /**< [GG.D2.TM] MPLS label 0, include: Label + Exp + S + TTL */
    uint32 mpls_label0_mask;                /**< [GG.D2.TM] MPLS label 0 mask*/
    uint32 mpls_label1;                     /**< [GG.D2.TM] MPLS label 1, include: Label + Exp + S + TTL */
    uint32 mpls_label1_mask;                /**< [GG.D2.TM] MPLS label 1 mask*/
    uint32 mpls_label2;                     /**< [GG.D2.TM] MPLS label 2, include: Label + Exp + S + TTL */
    uint32 mpls_label2_mask;                /**< [GG.D2.TM] MPLS label 2 mask*/

    uint8  mpls_label_num;                  /**< [GG.D2.TM] MPLS label number*/
    uint8  mpls_label_num_mask;             /**< [GG.D2.TM] MPLS label number mask*/

    uint8 ethoam_level;                     /**< [GB.GG.D2.TM] Ethernet oam level*/
    uint8 ethoam_level_mask;                /**< [GB.GG.D2.TM] Ethernet oam level mask*/


    uint8 ethoam_op_code;                   /**< [GB.GG.D2.TM] Ethernet oam op code*/
    uint8 ethoam_op_code_mask;              /**< [GB.GG.D2.TM] Ethernet oam op code mask*/

    uint8 gre_crks;                         /**< [GG] GRE C R K S 4 bits flags bitmap*/
    uint8 gre_crks_mask;                    /**< [GG] GRE C R K S 4 bits flags bitmap mask*/

    uint32 gre_key;                         /**< [GG.D2.TM] GRE key*/
    uint32 gre_key_mask;                    /**< [GG.D2.TM] GRE key mask*/

    uint32 metadata;                        /**< [GG.D2.TM] Metadata */
    uint32 metadata_mask;                   /**< [GG.D2.TM] Metadata mask*/

    uint32 vni;                             /**< [GG.D2.TM] share with l4 src port and dst port*/
    uint32 vni_mask;                        /**< [GG.D2.TM] share with l4 src port and dst port mask*/

    uint8 udf[CTC_ACL_UDF_BYTE_NUM];        /**< [GG] udf, bytes in packet combined */
    uint8 udf_mask[CTC_ACL_UDF_BYTE_NUM];   /**< [GG] udf mask*/

    uint8 udf_type;                         /**< [GG] udf type, refer ctc_parser_udf_type_t*/

    uint8 vlan_num;                         /**< [GG.D2.TM] vlan number */
    uint8 vlan_num_mask;                    /**< [GG.D2.TM] vlan number mask */

    ctc_field_port_t port;                  /**< [GB.GG.D2.TM] valid when group type CTC_ACL_GROUP_TYPE_NONE, refer to struct ctc_field_port_t */
    ctc_field_port_t port_mask;     /**< [GG.D2.TM] valid when group type CTC_ACL_GROUP_TYPE_NONE, refer to struct ctc_field_port_t */

    struct
    {
        uint8 sub_type;                 /**< [GG] Slow protocol sub type */
        uint8 sub_type_mask;            /**< [GG] Slow protocol sub type mask*/
        uint8 code;                     /**< [GG] Slow protocol code */
        uint8 code_mask;                /**< [GG] Slow protocol code mask*/
        uint16 flags;                   /**< [GG] Slow protocol flags */
        uint16 flags_mask;              /**< [GG] Slow protocol flags mask*/
    }slow_proto;
};
typedef struct ctc_acl_ipv4_key_s  ctc_acl_ipv4_key_t;

/**
@brief  Acl IPv6 Key Flag
*/
enum ctc_acl_ipv6_key_flag_e
{
    CTC_ACL_IPV6_KEY_FLAG_MAC_DA        = 1U << 0,  /**< [GB.GG.D2.TM] Valid MAC-DA in IPv6 key */
    CTC_ACL_IPV6_KEY_FLAG_MAC_SA        = 1U << 1,  /**< [GB.GG.D2.TM] Valid MAC-SA in IPv6 key */
    CTC_ACL_IPV6_KEY_FLAG_CVLAN         = 1U << 3,  /**< [GB.GG.D2.TM] Valid CVLAN in IPv6 key */
    CTC_ACL_IPV6_KEY_FLAG_CTAG_COS      = 1U << 4,  /**< [GB.GG.D2.TM] Valid Ctag CoS in IPv6 key */
    CTC_ACL_IPV6_KEY_FLAG_SVLAN         = 1U << 5,  /**< [GB.GG.D2.TM] Valid SVLAN in IPv6 key */
    CTC_ACL_IPV6_KEY_FLAG_STAG_COS      = 1U << 6,  /**< [GB.GG.D2.TM] Valid Stag CoS in IPv6 key */
    CTC_ACL_IPV6_KEY_FLAG_ETH_TYPE      = 1U << 7,  /**< [GB.GG] Valid Ether-type in IPv6 key */
    CTC_ACL_IPV6_KEY_FLAG_L2_TYPE       = 1U << 8,  /**< [GB] Valid L2-type CoS in IPv6 key */
    CTC_ACL_IPV6_KEY_FLAG_L3_TYPE       = 1U << 9,  /**< [GB.GG] Valid L3-type in IPv6 key */
    CTC_ACL_IPV6_KEY_FLAG_IP_SA         = 1U << 10, /**< [GB.GG.D2.TM] Valid IPv6-SA in IPv6 key */
    CTC_ACL_IPV6_KEY_FLAG_IP_DA         = 1U << 11, /**< [GB.GG.D2.TM] Valid IPv6-DA in IPv6 key */
    CTC_ACL_IPV6_KEY_FLAG_L4_PROTOCOL   = 1U << 12, /**< [GB.GG.D2.TM] Valid L4-Protocol in IPv6 key */
    CTC_ACL_IPV6_KEY_FLAG_DSCP          = 1U << 13, /**< [GB.GG.D2.TM] Valid DSCP in IPv6 key */
    CTC_ACL_IPV6_KEY_FLAG_PRECEDENCE    = 1U << 14, /**< [GB.GG.D2.TM] Valid IP Precedence in IPv6 key */
    CTC_ACL_IPV6_KEY_FLAG_IP_FRAG       = 1U << 15, /**< [GB.GG.D2.TM] Valid fragment in IPv6 key */
    CTC_ACL_IPV6_KEY_FLAG_IP_OPTION     = 1U << 16, /**< [GB.GG.D2.TM] Valid IP option in IPv6 key */
    CTC_ACL_IPV6_KEY_FLAG_ROUTED_PACKET = 1U << 17, /**< [GB.GG.D2.TM] Valid Routed-packet in IPv6 key */
    CTC_ACL_IPV6_KEY_FLAG_FLOW_LABEL    = 1U << 19, /**< [GB.GG.D2.TM] Valid IPv6 flow label in IPv6 key */
    CTC_ACL_IPV6_KEY_FLAG_CTAG_CFI      = 1U << 20, /**< [GB.GG.D2.TM] Valid C-tag Cfi in IPv6 key */
    CTC_ACL_IPV6_KEY_FLAG_STAG_CFI      = 1U << 21, /**< [GB.GG.D2.TM] Valid S-tag Cfi in IPv6 key */
    CTC_ACL_IPV6_KEY_FLAG_STAG_VALID    = 1U << 22, /**< [GB.GG.D2.TM] Valid Stag-valid in IPv6 key */
    CTC_ACL_IPV6_KEY_FLAG_CTAG_VALID    = 1U << 23, /**< [GB.GG.D2.TM] Valid Ctag-valid in IPv6 key */
    CTC_ACL_IPV6_KEY_FLAG_ECN           = 1U << 24, /**< [GG.D2.TM] Valid ECN in IPv6 key */
    CTC_ACL_IPV6_KEY_FLAG_METADATA      = 1U << 25, /**< [GG.D2.TM] Valid metadata in ipv6 key */
    CTC_ACL_IPV6_KEY_FLAG_UDF           = 1U << 26, /**< [GG.D2.TM] Valid udf in ipv6 key */
    CTC_ACL_IPV6_KEY_FLAG_VLAN_NUM      = 1U << 27, /**< [GG.D2.TM] Valid vlan number in ipv6 key */
    CTC_ACL_IPV6_KEY_FLAG_PKT_LEN_RANGE = 1U << 28, /**< [GG.D2.TM] Valid packet length range in ipv6 key */
    CTC_ACL_IPV6_KEY_FLAG_IP_HDR_ERROR  = 1U << 29  /**< [GG.D2.TM] Valid ip header error in ipv6 key */
};
typedef enum ctc_acl_ipv6_key_flag_e ctc_acl_ipv6_key_flag_t;



/**
@brief Define ACl IPv6 Key structure
*/
struct ctc_acl_ipv6_key_s
{
    uint32 flag;                 /**< [GB.GG.D2.TM] Bitmap of CTC_ACL_IPV6_KEY_FLAG_XXX */
    uint32 sub_flag;             /**< [GB.GG.D2.TM] Bitmap of CTC_ACL_IPV6_KEY_SUB_FLAG_XXX */

    ipv6_addr_t ip_sa;           /**< [GB.GG.D2.TM] IPv6-SA */
    ipv6_addr_t ip_sa_mask;      /**< [GB.GG.D2.TM] IPv6-SA mask */
    ipv6_addr_t ip_da;           /**< [GB.GG.D2.TM] IPv6-DA */
    ipv6_addr_t ip_da_mask;      /**< [GB.GG.D2.TM] IPv6-DA mask */

    uint16 l4_src_port_0;        /**< [GB.GG.D2.TM] Layer 4 source port.Min/Data */
    uint16 l4_src_port_1;        /**< [GB.GG.D2.TM] Layer 4 source port.Max/Mask */

    uint8  l4_src_port_use_mask; /**< [GB.GG.D2.TM] Use mask instead of range*/
    uint8  ip_option;            /**< [GB.GG.D2.TM] IP option */
    uint8  routed_packet;        /**< [GB.GG.D2.TM] Routed packet */
    uint8  l4_dst_port_use_mask; /**< [GB.GG.D2.TM] Use mask instead of range, dest_port is collision with l2_type and eth_type on GB*/

    uint16 l4_dst_port_0;        /**< [GB.GG.D2.TM] Layer 4 dest port */
    uint16 l4_dst_port_1;        /**< [GB.GG.D2.TM] Layer 4 dest port */

    uint32 pkt_len_min;          /**< [GG.D2.TM] Packet length Min */
    uint32 pkt_len_max;          /**< [GG.D2.TM] Packet Length Max */

    uint8  ip_frag;              /**< [GB.GG.D2.TM] Ip fragment, CTC_IP_FRAG_XXX */
    uint8  tcp_flags_match_any;  /**< [GB.GG.D2.TM] 0:match all 1:match any*/
    uint8  tcp_flags;            /**< [GB.GG.D2.TM] Tcp flag bitmap*/
    uint8  ip_hdr_error;       /**< [GG.D2.TM] ip header error packet */

    uint32 flow_label;           /**< [GB.GG.D2.TM] Flow label */
    uint32 flow_label_mask;      /**< [GB.GG.D2.TM] Flow label */

    uint8  l4_protocol;          /**< [GB.GG.D2.TM] Layer 4 protocol */
    uint8  l4_protocol_mask;     /**< [GB.GG.D2.TM] Layer 4 protocol mask*/
    uint8  icmp_type;            /**< [GB.GG.D2.TM] ICMP type */
    uint8  icmp_type_mask;       /**< [GB.GG.D2.TM] ICMP type mask*/

    uint8  icmp_code;            /**< [GB.GG.D2.TM] ICMP code */
    uint8  icmp_code_mask;       /**< [GB.GG.D2.TM] ICMP code mask*/
    uint8  dscp;                 /**< [GB.GG.D2.TM] DSCP */
    uint8  dscp_mask;            /**< [GB.GG.D2.TM] DSCP mask */

    mac_addr_t mac_sa;           /**< [GB.GG.D2.TM] MAC-SA */
    mac_addr_t mac_sa_mask;      /**< [GB.GG.D2.TM] MAC-SA mask */
    mac_addr_t mac_da;           /**< [GB.GG.D2.TM] MAC-DA */
    mac_addr_t mac_da_mask;      /**< [GB.GG.D2.TM] MAC-DA mask */

    uint16 eth_type;             /**< [GB.GG.D2.TM] Ethernet type */
    uint16 eth_type_mask;        /**< [GB.GG.D2.TM] Ethernet type mask */

    uint16 cvlan;                /**< [GB.GG.D2.TM] C-VLAN */
    uint16 cvlan_mask;           /**< [GB.GG.D2.TM] C-VLAN mask*/

    uint16 svlan;                /**< [GB.GG.D2.TM] S-VLAN */
    uint16 svlan_mask;           /**< [GB.GG.D2.TM] S-VLAN mask*/

    uint8  vrange_grpid;         /**< [GG.D2.TM] vlan range group id: 0~63 used in vlan range check*/
    uint16 cvlan_end;            /**< [GG.D2.TM] orignal max cvlan id need to do vlan range acl*/
    uint16 svlan_end;            /**< [GG.D2.TM] orignal max svlan id need to do vlan range acl*/

    uint8  ctag_cos;             /**< [GB.GG.D2.TM] C-tag CoS */
    uint8  ctag_cos_mask;        /**< [GB.GG.D2.TM] C-tag CoS mask */
    uint8  stag_cos;             /**< [GB.GG.D2.TM] S-tag CoS */
    uint8  stag_cos_mask;        /**< [GB.GG.D2.TM] S-tag Cos mask */

    uint8  ctag_cfi;             /**< [GB.GG.D2.TM] C-tag CFI */
    uint8  stag_cfi;             /**< [GB.GG.D2.TM] S-tag CFI */
    uint8  l2_type;              /**< [GB] Layer 2 type Refer to ctc_parser_l2_type_t */
    uint8  l2_type_mask;         /**< [GB] Layer 2 type mask*/


    uint8  stag_valid;           /**< [GB.GG.D2.TM] Stag valid*/
    uint8  ctag_valid;           /**< [GB.GG.D2.TM] Ctag valid*/
    uint8  l3_type;              /**< [GB.GG.D2.TM] Layer 3 type Refer to ctc_parser_l3_type_t */
    uint8  l3_type_mask;         /**< [GB.GG.D2.TM] Layer 3 type mask*/

    uint8  ecn;                  /**< [GG.D2.TM] ecn*/
    uint8  ecn_mask;             /**< [GG.D2.TM] ecn mask*/

    uint8 gre_crks;              /**< [GG] GRE C R K S 4 bits flags bitmap*/
    uint8 gre_crks_mask;         /**< [GG] GRE C R K S 4 bits flags bitmap mask*/

    uint32 gre_key;              /**< [GG.D2.TM] share with l4 src port and dst port*/
    uint32 gre_key_mask;         /**< [GG.D2.TM] share with l4 src port and dst port mask*/

    uint32 metadata;             /**< [GG.D2.TM] metadata */
    uint32 metadata_mask;        /**< [GG.D2.TM] metadata mask*/

    uint32 vni;                  /**< [GG.D2.TM] share with l4 src port and dst port*/
    uint32 vni_mask;             /**< [GG.D2.TM] share with l4 src port and dst port mask*/

    uint8 udf[CTC_ACL_UDF_BYTE_NUM];          /**< [GG] udf, bytes in packet combined */
    uint8 udf_mask[CTC_ACL_UDF_BYTE_NUM];     /**< [GG] udf mask*/

    uint8 udf_type;                           /**< [GG] udf type, refer ctc_parser_udf_type_t*/

    uint8 vlan_num;                           /**< [GG.D2.TM] vlan number */
    uint8 vlan_num_mask;                      /**< [GG.D2.TM] vlan number mask */

    ctc_field_port_t port;                    /**< [GB.GG.D2.TM] valid when group type CTC_ACL_GROUP_TYPE_NONE, refer to struct ctc_field_port_t */
    ctc_field_port_t port_mask;     /**< [GG.D2.TM] valid when group type CTC_ACL_GROUP_TYPE_NONE, refer to struct ctc_field_port_t */

};
typedef struct ctc_acl_ipv6_key_s ctc_acl_ipv6_key_t;

/**
@brief Define ACl Hash Mac Key structure
*/
struct ctc_acl_hash_mac_key_s
{
    uint32 field_sel_id;         /**< [GG.D2.TM] Field Select Id*/

    uint32 gport;                /**< [GB.GG.D2.TM] Global source port, share with logic port and metadata */
    uint8  gport_is_logic_port;  /**< [GB] GPort is logic port */

    mac_addr_t mac_da;           /**< [GB.GG.D2.TM] MAC-DA */
    mac_addr_t mac_sa;           /**< [GG.D2.TM] MAC-SA */

    uint16 eth_type;             /**< [GB.GG.D2.TM] Ethernet type */

    uint8  is_ctag;              /**< [GG.D2.TM] tag is ctag */
    uint8  cos;                  /**< [GB.GG.D2.TM] tag Cos */
    uint16 vlan_id;              /**< [GB.GG.D2.TM] tag Vlan Id */
    uint8  tag_valid;            /**< [GG.D2.TM] tag exist */
    uint8  cfi;                  /**< [GG.D2.TM] tag Cfi */

    uint8  vrange_grpid;         /**< [GG.D2.TM] vlan range group id: 0~63 used in vlan range check*/
    uint16 vlan_end;             /**< [GG.D2.TM] orignal max c/s vlan id need to do vlan range acl*/
};
typedef struct ctc_acl_hash_mac_key_s  ctc_acl_hash_mac_key_t;

/**
@brief Define ACl Hash Ipv4 Key structure
*/
struct ctc_acl_hash_ipv4_key_s
{
    uint32 field_sel_id;         /**< [GG.D2.TM] Field Select Id*/

    uint32 gport;                /**< [GB.GG.D2.TM] Global source port */
    uint8  gport_is_logic_port;  /**< [GB] Gport is logic port */
    uint8  rsv;
    uint32 metadata;             /**< [GG.D2.TM] Metadata */

    uint32 ip_sa;                /**< [GB.GG.D2.TM] IP-SA */
    uint32 ip_da;                /**< [GB.GG.D2.TM] IP-DA */

    uint8  dscp;                 /**< [GB.GG.D2.TM] DSCP */
    uint8  ecn;                  /**< [GG.D2.TM] ECN */
    uint8  l4_protocol;          /**< [GB.GG.D2.TM] L4 Protocol */
    uint8  arp_packet;           /**< [GB] Is arp packet */

    uint8  icmp_type;            /**< [GG.D2.TM] ICMP type */
    uint8  icmp_code;            /**< [GG.D2.TM] ICMP code */

    uint16 l4_src_port;          /**< [GB.GG.D2.TM] Layer 4 source port.*/
    uint16 l4_dst_port;          /**< [GB.GG.D2.TM] Layer 4 dest port */

    uint32 vni;                  /**< [GG.D2.TM] Vxlan Vni ID */
    uint32 gre_key;              /**< [GG.D2.TM] Gre or Nvgre Key*/

    uint8  is_route_mac;         /**< [GG.D2.TM] MacDa is route mac*/
};
typedef struct ctc_acl_hash_ipv4_key_s  ctc_acl_hash_ipv4_key_t;

/**
@brief Define ACl Hash Ipv6 Key structure
*/
struct ctc_acl_hash_ipv6_key_s
{
    uint32 field_sel_id;         /**< [GG.D2.TM] Field Select Id*/

    uint32 gport;                /**< [GG.D2.TM] Global source port, share with logic port and metadata*/
    ipv6_addr_t ip_sa;           /**< [GG.D2.TM] IP-SA */
    ipv6_addr_t ip_da;           /**< [GG.D2.TM] IP-DA */

    uint8  dscp;                 /**< [GG.D2.TM] DSCP */
    uint8  l4_type;              /**< [GG.D2.TM] Layer 4 type */
    uint8  icmp_type;            /**< [GG.D2.TM] ICMP type */
    uint8  icmp_code;            /**< [GG.D2.TM] ICMP code */

    uint16 l4_src_port;          /**< [GG.D2.TM] Layer 4 source port.*/
    uint16 l4_dst_port;          /**< [GG.D2.TM] Layer 4 dest port */
    uint32 vni;                  /**< [GG.D2.TM] Vxlan Vni ID */
    uint32 gre_key;              /**< [GG.D2.TM] Gre or Nvgre Key*/
};
typedef struct ctc_acl_hash_ipv6_key_s  ctc_acl_hash_ipv6_key_t;

/**
@brief Define ACl Hash Mpls Key structure
*/
struct ctc_acl_hash_mpls_key_s
{
    uint32 field_sel_id;          /**< [GG.D2.TM] Field Select Id*/

    uint32 gport;                 /**< [GG.D2.TM] Global source port */
    uint32 metadata;              /**< [GG.D2.TM] Metadata */

    uint8  mpls_label_num;        /**< [GG.D2.TM] MPLS Label Number */

    uint32 mpls_label0_label;     /**< [GG.D2.TM] MPLS Label 0 */
    uint8  mpls_label0_exp;       /**< [GG.D2.TM] MPLS Exp 0 */
    uint8  mpls_label0_s;         /**< [GG.D2.TM] MPLS S-bit 0 */
    uint8  mpls_label0_ttl;       /**< [GG.D2.TM] MPLS Ttl 0 */

    uint32 mpls_label1_label;     /**< [GG.D2.TM] MPLS Label 1 */
    uint8  mpls_label1_exp;       /**< [GG.D2.TM] MPLS Exp 1 */
    uint8  mpls_label1_s;         /**< [GG.D2.TM] MPLS S-bit 1 */
    uint8  mpls_label1_ttl;       /**< [GG.D2.TM] MPLS Ttl 1 */

    uint32 mpls_label2_label;     /**< [GG.D2.TM] MPLS Label 2 */
    uint8  mpls_label2_exp;       /**< [GG.D2.TM] MPLS Exp 2 */
    uint8  mpls_label2_s;         /**< [GG.D2.TM] MPLS S-bit 2 */
    uint8  mpls_label2_ttl;       /**< [GG.D2.TM] MPLS Ttl 2 */
};
typedef struct ctc_acl_hash_mpls_key_s  ctc_acl_hash_mpls_key_t;

/**
@brief Define ACl Hash L2_L3 Key structure
*/
struct ctc_acl_hash_l2_l3_key_s
{
    uint32 field_sel_id;        /**< [GG.D2.TM] Field Select Id*/
    uint8  l3_type;             /**< [GG.D2.TM] config to distinguish mpls, ipv4. refer ctc_parser_l3_type_t  */

    uint32 gport;               /**< [GG.D2.TM] Global source port */
    uint32 metadata;            /**< [GG.D2.TM] Metadata*/

    mac_addr_t mac_da;          /**< [GG.D2.TM] MAC-DA */
    mac_addr_t mac_sa;          /**< [GG.D2.TM] MAC-DA */

    uint8  stag_cos;            /**< [GG.D2.TM] Stag Cos */
    uint16 stag_vlan;           /**< [GG.D2.TM] Stag Vlan Id */
    uint8  stag_valid;          /**< [GG.D2.TM] Stag Exist */
    uint8  stag_cfi;            /**< [GG.D2.TM] Stag Cos */

    uint8  ctag_cos;            /**< [GG.D2.TM] Ctag Cos */
    uint16 ctag_vlan;           /**< [GG.D2.TM] Ctag Vlan Id */
    uint8  ctag_valid;          /**< [GG.D2.TM] Ctag Exist */
    uint8  ctag_cfi;            /**< [GG.D2.TM] Ctag Cos */

    uint8  vrange_grpid;        /**< [GG.D2.TM] vlan range group id: 0~63 used in vlan range check*/
    uint16 cvlan_end;           /**< [GG.D2.TM] orignal max cvlan id need to do vlan range acl*/
    uint16 svlan_end;           /**< [GG.D2.TM] orignal max svlan id need to do vlan range acl*/

    uint32 ip_sa;               /**< [GG.D2.TM] IP-SA */
    uint32 ip_da;               /**< [GG.D2.TM] IP-DA */

    uint8  dscp;                /**< [GG.D2.TM] DSCP */
    uint8  ecn;                 /**< [GG.D2.TM] ECN*/
    uint8  ttl;                 /**< [GG.D2.TM] TTL */

    uint16 eth_type;            /**< [GG.D2.TM] Ethernet type */
    uint8  l4_type;             /**< [GG.D2.TM] Layer4 type */

    uint8  mpls_label_num;      /**< [GG.D2.TM] Label Num */

    uint32 mpls_label0_label;   /**< [GG.D2.TM] MPLS Label 0 */
    uint8  mpls_label0_exp;     /**< [GG.D2.TM] MPLS Exp 0 */
    uint8  mpls_label0_s;       /**< [GG.D2.TM] MPLS S-bit 0 */
    uint8  mpls_label0_ttl;     /**< [GG.D2.TM] MPLS Ttl 0 */

    uint32 mpls_label1_label;   /**< [GG.D2.TM] MPLS Label 1 */
    uint8  mpls_label1_exp;     /**< [GG.D2.TM] MPLS Exp 1 */
    uint8  mpls_label1_s;       /**< [GG.D2.TM] MPLS S-bit 1 */
    uint8  mpls_label1_ttl;     /**< [GG.D2.TM] MPLS Ttl 1 */

    uint32 mpls_label2_label;   /**< [GG.D2.TM] MPLS Label 2 */
    uint8  mpls_label2_exp;     /**< [GG.D2.TM] MPLS Exp 2 */
    uint8  mpls_label2_s;       /**< [GG.D2.TM] MPLS S-bit 2 */
    uint8  mpls_label2_ttl;     /**< [GG.D2.TM] MPLS Ttl 2 */

    uint16 l4_src_port;         /**< [GG.D2.TM] Layer 4 source port.*/
    uint16 l4_dst_port;         /**< [GG.D2.TM] Layer 4 dest port */

    uint8  icmp_type;           /**< [GG.D2.TM] ICMP type */
    uint8  icmp_code;           /**< [GG.D2.TM] ICMP code */
    uint32 vni;                  /**< [GG.D2.TM] Vxlan Vni ID */
    uint32 gre_key;              /**< [GG.D2.TM] Gre or Nvgre Key*/
};
typedef struct ctc_acl_hash_l2_l3_key_s  ctc_acl_hash_l2_l3_key_t;

/**
@brief  Acl Pbr IPv4 Key Flag
*/
enum ctc_acl_pbr_ipv4_key_flag_e
{
    CTC_ACL_PBR_IPV4_KEY_FLAG_IP_SA         = 1U << 0, /**< [GB.GG.D2.TM] Valid IP-SA in IPv4 key */
    CTC_ACL_PBR_IPV4_KEY_FLAG_IP_DA         = 1U << 1, /**< [GB.GG.D2.TM] Valid IP-DA in IPv4 key */
    CTC_ACL_PBR_IPV4_KEY_FLAG_L4_PROTOCOL   = 1U << 2, /**< [GB.GG.D2.TM] Valid L4-Proto in IPv4 key */
    CTC_ACL_PBR_IPV4_KEY_FLAG_DSCP          = 1U << 3, /**< [GB.GG.D2.TM] Valid DSCP in IPv4 key */
    CTC_ACL_PBR_IPV4_KEY_FLAG_PRECEDENCE    = 1U << 4, /**< [GB.GG.D2.TM] Valid IP Precedence in IPv4 key */
    CTC_ACL_PBR_IPV4_KEY_FLAG_IP_FRAG       = 1U << 5, /**< [GB.GG.D2.TM] Valid fragment in IPv4 key */
    CTC_ACL_PBR_IPV4_KEY_FLAG_VRFID         = 1U << 6  /**< [GB.GG.D2.TM] Valid vrfid in IPv4 key */
};
typedef enum ctc_acl_pbr_ipv4_key_flag_e ctc_acl_pbr_ipv4_key_flag_t;

/**
@brief  Acl Pbr IPv4 Key Sub Flag
*/
enum ctc_acl_pbr_ipv4_key_sub_flag_e
{
    CTC_ACL_PBR_IPV4_KEY_SUB_FLAG_L4_SRC_PORT     = 1U << 0, /**< [GB.GG.D2.TM] Depend on L4_PROTOCOL = TCP|UDP  Valid L4 source port in IPv4 key */
    CTC_ACL_PBR_IPV4_KEY_SUB_FLAG_L4_DST_PORT     = 1U << 1, /**< [GB.GG.D2.TM] Depend on L4_PROTOCOL = TCP|UDP  Valid L4 destination port in IPv4 key */
    CTC_ACL_PBR_IPV4_KEY_SUB_FLAG_TCP_FLAGS       = 1U << 2, /**< [GB.GG.D2.TM] Depend on L4_PROTOCOL = TCP Valid TCP flag in IPv4 key */
    CTC_ACL_PBR_IPV4_KEY_SUB_FLAG_ICMP_TYPE       = 1U << 3, /**< [GB.GG.D2.TM] Depend on L4_PROTOCOL = ICMP Valid ICMP type in IPv4 key */
    CTC_ACL_PBR_IPV4_KEY_SUB_FLAG_ICMP_CODE       = 1U << 4  /**< [GB.GG.D2.TM] Depend on L4_PROTOCOL = ICMP Valid ICMP code in IPv4 key */
};
typedef enum ctc_acl_pbr_ipv4_key_sub_flag_e ctc_acl_pbr_ipv4_key_sub_flag_t;

/**
@brief Define ACl Pbr IPv4 Key structure
*/
struct ctc_acl_pbr_ipv4_key_s
{
    uint32 flag;                        /**< [GB.GG.D2.TM] Bitmap of CTC_ACL_PBR_IPV4_KEY_FLAG_XXX */
    uint32 sub_flag;                    /**< [GB.GG.D2.TM] Bitmap of CTC_ACL_PBR_IPV4_KEY_SUB_FLAG_XXX */

    uint32 ip_sa;                       /**< [GB.GG.D2.TM] IP-SA */
    uint32 ip_sa_mask;                  /**< [GB.GG.D2.TM] IP-SA mask */
    uint32 ip_da;                       /**< [GB.GG.D2.TM] IP-DA */
    uint32 ip_da_mask;                  /**< [GB.GG.D2.TM] IP-DA mask */

    uint16 l4_src_port_0;               /**< [GB.GG.D2.TM] Layer 4 source port.Min/Data */
    uint16 l4_src_port_1;               /**< [GB.GG.D2.TM] Layer 4 source port.Max/Mask */

    uint8  l4_src_port_use_mask;        /**< [GB.GG.D2.TM] Use mask instead of range*/
    uint8  l4_dst_port_use_mask;        /**< [GB.GG.D2.TM] Use mask instead of range*/
    uint8  ip_frag;                     /**< [GB.GG.D2.TM] Ip fragment, CTC_IP_FRAG_XXX */
    uint8  rsv1;

    uint16 l4_dst_port_0;               /**< [GB.GG.D2.TM] Layer 4 dest port */
    uint16 l4_dst_port_1;               /**< [GB.GG.D2.TM] Layer 4 dest port */

    uint8  tcp_flags_match_any;         /**< [GB.GG.D2.TM] 0:match all. 1:match any*/
    uint8  tcp_flags;                   /**< [GB.GG.D2.TM] Tcp flag bitmap*/
    uint8  dscp;                        /**< [GB.GG.D2.TM] DSCP */
    uint8  dscp_mask;                   /**< [GB.GG.D2.TM] DSCP mask*/

    uint8  l4_protocol;                 /**< [GB.GG.D2.TM] Layer 4 protocol */
    uint8  l4_protocol_mask;            /**< [GB.GG.D2.TM] Layer 4 protocol mask*/
    uint8  rsv2[2];

    uint8  icmp_type;                   /**< [GB.GG.D2.TM] ICMP type */
    uint8  icmp_type_mask;              /**< [GB.GG.D2.TM] ICMP type mask*/
    uint8  icmp_code;                   /**< [GB.GG.D2.TM] ICMP code */
    uint8  icmp_code_mask;              /**< [GB.GG.D2.TM] ICMP code mask*/

    uint16 vrfid;                       /**< [GB.GG.D2.TM] VRFID */
    uint16 vrfid_mask;                  /**< [GB.GG.D2.TM] VRFID mask*/

    ctc_field_port_t port;              /**< [GB.GG.D2.TM] valid when group type CTC_ACL_GROUP_TYPE_NONE, refer to struct ctc_field_port_t */
    ctc_field_port_t port_mask;     /**< [GG.D2.TM] valid when group type CTC_ACL_GROUP_TYPE_NONE, refer to struct ctc_field_port_t */
};
typedef struct ctc_acl_pbr_ipv4_key_s  ctc_acl_pbr_ipv4_key_t;

/**
@brief  Acl IPv6 Key Sub Flag
*/
enum ctc_acl_ipv6_key_sub_flag_e
{
    CTC_ACL_IPV6_KEY_SUB_FLAG_L4_SRC_PORT  = 1U << 0, /**< [GB.GG.D2.TM] Depend on L4_PROTOCOL = TCP|UDP Valid L4 source port in IPv6 key */
    CTC_ACL_IPV6_KEY_SUB_FLAG_L4_DST_PORT  = 1U << 1, /**< [GB.GG.D2.TM] Depend on L4_PROTOCOL = TCP|UDP Valid L4 destination port in IPv6 key */
    CTC_ACL_IPV6_KEY_SUB_FLAG_TCP_FLAGS    = 1U << 2, /**< [GB.GG.D2.TM] Depend on L4_PROTOCOL = TCP    Valid TCP flags in IPv6 key */
    CTC_ACL_IPV6_KEY_SUB_FLAG_ICMP_TYPE    = 1U << 3, /**< [GB.GG.D2.TM] Depend on L4_PROTOCOL = ICMP   Valid ICMP type in IPv6 key */
    CTC_ACL_IPV6_KEY_SUB_FLAG_ICMP_CODE    = 1U << 4, /**< [GB.GG.D2.TM] Depend on L4_PROTOCOL = ICMP   Valid ICMP code in IPv6 key */
    CTC_ACL_IPV6_KEY_SUB_FLAG_GRE_KEY      = 1U << 5, /**< [GG.D2.TM] Depend on L4_PROTOCOL = GRE    Valid GRE key in IPv6 key */
    CTC_ACL_IPV6_KEY_SUB_FLAG_VNI          = 1U << 6, /**< [GG.D2.TM] Depend on L4_PROTOCOL = UDP    Valid vni in IPv6 key */
    CTC_ACL_IPV6_KEY_SUB_FLAG_NVGRE_KEY    = 1U << 7, /**< [GG.D2.TM] Depend on L4_PROTOCOL = NVGRE    Valid NVGRE key in IPv6 key */
    CTC_ACL_IPV6_KEY_SUB_FLAG_GRE_CRKS     = 1U << 8   /**< [GG] Depend on L4_PROTOCOL = GRE, valid C R K S 4 bits in GRE header  in IPv6 key*/
};
typedef enum ctc_acl_ipv6_key_sub_flag_e ctc_acl_ipv6_key_sub_flag_t;

/**
@brief  Acl Pbr IPv6 Key Flag
*/
enum ctc_acl_pbr_ipv6_key_flag_e
{
    CTC_ACL_PBR_IPV6_KEY_FLAG_MAC_DA        = 1U << 0,  /**< [GB] Valid MAC-DA in IPv6 key */
    CTC_ACL_PBR_IPV6_KEY_FLAG_MAC_SA        = 1U << 1,  /**< [GB] Valid MAC-SA in IPv6 key */
    CTC_ACL_PBR_IPV6_KEY_FLAG_CVLAN         = 1U << 2,  /**< [GB] Valid CVLAN in IPv6 key */
    CTC_ACL_PBR_IPV6_KEY_FLAG_CTAG_COS      = 1U << 3,  /**< [GB] Valid Ctag CoS in IPv6 key */
    CTC_ACL_PBR_IPV6_KEY_FLAG_SVLAN         = 1U << 4,  /**< [GB] Valid SVLAN in IPv6 key */
    CTC_ACL_PBR_IPV6_KEY_FLAG_STAG_COS      = 1U << 5,  /**< [GB] Valid Stag CoS in IPv6 key */
    CTC_ACL_PBR_IPV6_KEY_FLAG_ETH_TYPE      = 1U << 6,  /**< [GB] Valid Ether-type in IPv6 key */
    CTC_ACL_PBR_IPV6_KEY_FLAG_L2_TYPE       = 1U << 7,  /**< [GB] Valid L2-type CoS in IPv6 key */
    CTC_ACL_PBR_IPV6_KEY_FLAG_L3_TYPE       = 1U << 8,  /**< [GB] Valid L3-type in IPv6 key */
    CTC_ACL_PBR_IPV6_KEY_FLAG_IP_SA         = 1U << 9,  /**< [GB.GG.D2.TM] Valid IPv6-SA in IPv6 key */
    CTC_ACL_PBR_IPV6_KEY_FLAG_IP_DA         = 1U << 10, /**< [GB.GG.D2.TM] Valid IPv6-DA in IPv6 key */
    CTC_ACL_PBR_IPV6_KEY_FLAG_L4_PROTOCOL   = 1U << 11, /**< [GB.GG.D2.TM] Valid L4-Protocol in IPv6 key */
    CTC_ACL_PBR_IPV6_KEY_FLAG_DSCP          = 1U << 12, /**< [GB.GG.D2.TM] Valid DSCP in IPv6 key */
    CTC_ACL_PBR_IPV6_KEY_FLAG_PRECEDENCE    = 1U << 13, /**< [GB.GG.D2.TM] Valid IP Precedence in IPv6 key */
    CTC_ACL_PBR_IPV6_KEY_FLAG_IP_FRAG       = 1U << 14, /**< [GB.GG.D2.TM] Valid fragment in IPv6 key */
    CTC_ACL_PBR_IPV6_KEY_FLAG_FLOW_LABEL    = 1U << 15, /**< [GB.GG.D2.TM] Valid IPv6 flow label in IPv6 key */
    CTC_ACL_PBR_IPV6_KEY_FLAG_CTAG_CFI      = 1U << 16, /**< [GB] Valid C-tag Cfi in IPv6 key */
    CTC_ACL_PBR_IPV6_KEY_FLAG_STAG_CFI      = 1U << 17, /**< [GB] Valid S-tag Cfi in IPv6 key */
    CTC_ACL_PBR_IPV6_KEY_FLAG_VRFID         = 1U << 18, /**< [GB.GG.D2.TM] Valid vrfid in IPv6 key */
};
typedef enum ctc_acl_pbr_ipv6_key_flag_e ctc_acl_pbr_ipv6_key_flag_t;

/**
@brief Define ACl Pbr IPv6 Key structure
*/
struct ctc_acl_pbr_ipv6_key_s
{
    uint32 flag;                        /**< [GB.GG.D2.TM] Bitmap of CTC_ACL_IPV6_KEY_FLAG_XXX */
    uint32 sub_flag;                    /**< [GB.GG.D2.TM] Bitmap of CTC_ACL_IPV6_KEY_SUB_FLAG_XXX */

    ipv6_addr_t ip_sa;                  /**< [GB.GG.D2.TM] IPv6-SA */
    ipv6_addr_t ip_sa_mask;             /**< [GB.GG.D2.TM] IPv6-SA mask */
    ipv6_addr_t ip_da;                  /**< [GB.GG.D2.TM] IPv6-DA */
    ipv6_addr_t ip_da_mask;             /**< [GB.GG.D2.TM] IPv6-DA mask */

    uint16 l4_src_port_0;               /**< [GB.GG.D2.TM] Layer 4 source port.Min/Data */
    uint16 l4_src_port_1;               /**< [GB.GG.D2.TM] Layer 4 source port.Max/Mask */

    uint8  l4_src_port_use_mask;        /**< [GB.GG.D2.TM] Use mask instead of range*/
    uint8  l4_dst_port_use_mask;        /**< [GB.GG.D2.TM] Use mask instead of range. dest_port is collision with l2_type and eth_type on GB.*/
    uint8  l3_type;                     /**< [GB] Layer 3 type. Refer to ctc_parser_l3_type_t */
    uint8  l3_type_mask;                /**< [GB] Layer 3 type mask*/

    uint16 l4_dst_port_0;               /**< [GB.GG.D2.TM] Layer 4 dest port */
    uint16 l4_dst_port_1;               /**< [GB.GG.D2.TM] Layer 4 dest port */

    uint8  ip_frag;                     /**< [GB.GG.D2.TM] Ip fragment, CTC_IP_FRAG_XXX */
    uint8  tcp_flags_match_any;         /**< [GB.GG.D2.TM] 0:match all. 1:match any*/
    uint8  tcp_flags;                   /**< [GB.GG.D2.TM] Tcp flag bitmap*/
    uint8  rsv0;

    uint32 flow_label;                  /**< [GB.GG.D2.TM] Flow label */
    uint32 flow_label_mask;             /**< [GB.GG.D2.TM] Flow label */

    uint8  l4_protocol;                 /**< [GB.GG.D2.TM] Layer 4 protocol */
    uint8  l4_protocol_mask;            /**< [GB.GG.D2.TM] Layer 4 protocol mask*/
    uint8  icmp_type;                   /**< [GB.GG.D2.TM] ICMP type */
    uint8  icmp_type_mask;              /**< [GB.GG.D2.TM] ICMP type mask*/

    uint8  icmp_code;                   /**< [GB.GG.D2.TM] ICMP code */
    uint8  icmp_code_mask;              /**< [GB.GG.D2.TM] ICMP code mask*/
    uint8  dscp;                        /**< [GB.GG.D2.TM] DSCP */
    uint8  dscp_mask;                   /**< [GB.GG.D2.TM] DSCP mask */

    mac_addr_t mac_sa;                  /**< [GB.D2.TM] MAC-SA */
    mac_addr_t mac_sa_mask;             /**< [GB.D2.TM] MAC-SA mask */
    mac_addr_t mac_da;                  /**< [GB.D2.TM] MAC-DA */
    mac_addr_t mac_da_mask;             /**< [GB.D2.TM] MAC-DA mask */

    uint16 eth_type;                    /**< [GB] Ethernet type */
    uint16 eth_type_mask;               /**< [GB] Ethernet type mask */

    uint16 cvlan;                       /**< [GB] C-VLAN */
    uint16 cvlan_mask;                  /**< [GB] C-VLAN mask*/

    uint16 svlan;                       /**< [GB] S-VLAN */
    uint16 svlan_mask;                  /**< [GB] S-VLAN mask*/

    uint8  ctag_cos;                    /**< [GB] C-tag CoS */
    uint8  ctag_cos_mask;               /**< [GB] C-tag CoS mask */
    uint8  stag_cos;                    /**< [GB] S-tag CoS */
    uint8  stag_cos_mask;               /**< [GB] S-tag Cos mask */

    uint8  ctag_cfi;                    /**< [GB] C-tag CFI */
    uint8  stag_cfi;                    /**< [GB] S-tag CFI */
    uint8  l2_type;                     /**< [GB] Layer 2 type. Refer to ctc_parser_l2_type_t */
    uint8  l2_type_mask;                /**< [GB] Layer 2 type mask*/


    uint16 vrfid;                       /**< [GB.GG.D2.TM] VRFID */
    uint16 vrfid_mask;                  /**< [GB.GG.D2.TM] VRFID mask*/

    ctc_field_port_t port;              /**< [GB.GG.D2.TM] valid when group type CTC_ACL_GROUP_TYPE_NONE, refer to struct ctc_field_port_t */
    ctc_field_port_t port_mask;     /**< [GG.D2.TM] valid when group type CTC_ACL_GROUP_TYPE_NONE, refer to struct ctc_field_port_t */
};
typedef struct ctc_acl_pbr_ipv6_key_s ctc_acl_pbr_ipv6_key_t;

/**
@brief Define ACl Key structure
*/
struct ctc_acl_key_s
{
    ctc_acl_key_type_t type;                        /**< [GB.GG.D2.TM] ctc_acl_key_type_t */

    union
    {
        ctc_acl_mac_key_t  mac_key;                 /**< [GB.GG.D2.TM] ACL MAC key content */
        ctc_acl_mpls_key_t mpls_key;                /**< [GB.GG.D2.TM] ACL MPLS key content */
        ctc_acl_ipv4_key_t ipv4_key;                /**< [GB.GG.D2.TM] ACL IPv4 key content */
        ctc_acl_ipv6_key_t ipv6_key;                /**< [GB.GG.D2.TM] ACL IPv6 key content */
        ctc_acl_hash_mac_key_t  hash_mac_key;       /**< [GB.GG.D2.TM] ACL MAC Hash key content */
        ctc_acl_hash_ipv4_key_t hash_ipv4_key;      /**< [GB.GG.D2.TM] ACL IPv4 Hash key content */
        ctc_acl_hash_ipv6_key_t hash_ipv6_key;      /**< [GG.D2.TM] ACL IPv6 Hash key content */
        ctc_acl_hash_mpls_key_t hash_mpls_key;      /**< [GG.D2.TM] ACL MPLS Hash key content */
        ctc_acl_hash_l2_l3_key_t hash_l2_l3_key;    /**< [GG.D2.TM] ACL L2 L3 key content */
        ctc_acl_pbr_ipv4_key_t pbr_ipv4_key;        /**< [GB.GG.D2.TM] ACL PBR IPv4 key content */
        ctc_acl_pbr_ipv6_key_t pbr_ipv6_key;        /**< [GB.GG.D2.TM] ACL PBR IPv6 key content */
    } u;
};
typedef struct ctc_acl_key_s ctc_acl_key_t;

/**
@brief  Acl Action Flag
*/
enum ctc_acl_action_flag_e
{
    CTC_ACL_ACTION_FLAG_DISCARD                        = 1U << 0,  /**< [GB.GG.D2.TM] Discard the packet i:ingress e:egress*/
    CTC_ACL_ACTION_FLAG_DENY_BRIDGE                    = 1U << 1,  /**< [GB.GG.D2.TM] Deny bridging process */
    CTC_ACL_ACTION_FLAG_DENY_LEARNING                  = 1U << 2,  /**< [GB.GG.D2.TM] Deny learning process */
    CTC_ACL_ACTION_FLAG_DENY_ROUTE                     = 1U << 3,  /**< [GB.GG.D2.TM] Deny routing process */
    CTC_ACL_ACTION_FLAG_STATS                          = 1U << 6,  /**< [GB.GG.D2.TM] Statistic */
    CTC_ACL_ACTION_FLAG_PRIORITY_AND_COLOR             = 1U << 8,  /**< [GB.GG.D2.TM] Priority color */
    CTC_ACL_ACTION_FLAG_TRUST                          = 1U << 9,  /**< [GB.GG] QoS trust state */
    CTC_ACL_ACTION_FLAG_MICRO_FLOW_POLICER             = 1U << 10, /**< [GB.GG.D2.TM] Micro Flow policer */
    CTC_ACL_ACTION_FLAG_RANDOM_LOG                     = 1U << 11, /**< [GB.GG.D2.TM] Log to any network port */
    CTC_ACL_ACTION_FLAG_COPY_TO_CPU                    = 1U << 12, /**< [GB.GG.D2.TM] Copy to cpu */
    CTC_ACL_ACTION_FLAG_REDIRECT                       = 1U << 13, /**< [GB.GG.D2.TM] Redirect */
    CTC_ACL_ACTION_FLAG_DSCP                           = 1U << 14, /**< [GB.GG.D2.TM] Dscp */
    CTC_ACL_ACTION_FLAG_COPY_TO_CPU_WITH_TIMESTAMP     = 1U << 15, /**< [GB] Copy to cpu with timestamp */
    CTC_ACL_ACTION_FLAG_QOS_DOMAIN                     = 1U << 16, /**< [GB.GG] Qos domain */
    CTC_ACL_ACTION_FLAG_MACRO_FLOW_POLICER             = 1U << 17, /**< [GB.GG.D2.TM] Macro Flow Policer */
    CTC_ACL_ACTION_FLAG_AGING                          = 1U << 18, /**< [GB] Aging */
    CTC_ACL_ACTION_FLAG_VLAN_EDIT                      = 1U << 19, /**< [GB.GG.D2.TM] Vlan edit */
    CTC_ACL_ACTION_FLAG_PRIORITY                       = 1U << 26, /**< [GG.D2.TM] Priority*/
    CTC_ACL_ACTION_FLAG_COLOR                          = 1U << 27, /**< [GG.D2.TM] Color id */
    CTC_ACL_ACTION_FLAG_DISABLE_IPFIX                  = 1U << 28, /**< [GG.D2.TM] Disable ipfix*/
    CTC_ACL_ACTION_FLAG_DENY_IPFIX_LEARNING            = 1U << 29, /**< [GG.D2.TM] Deny ipfix learning*/
    CTC_ACL_ACTION_FLAG_POSTCARD_EN                    = 1U << 30, /**< [GG] Enable postcard*/
    CTC_ACL_ACTION_FLAG_CANCEL_DISCARD                 = 1U << 31, /**< [GG.D2.TM] Cancel discard the packet */
    CTC_ACL_ACTION_FLAG_ASSIGN_OUTPUT_PORT             = 1LLU << 32, /**<[GG] DestId assigned by user */
    CTC_ACL_ACTION_FLAG_FORCE_ROUTE                    = 1LLU << 33,  /**< [GG] Force routing process,will cancel deny route,deny bridge */
    CTC_ACL_ACTION_FLAG_METADATA                       = 1LLU << 34, /**< [GG.D2.TM] Metadata */
    CTC_ACL_ACTION_FLAG_FID                            = 1LLU << 35, /**< [GG] fid */
    CTC_ACL_ACTION_FLAG_VRFID                          = 1LLU << 36,  /**< [GG] Vrf ID of the route */
    CTC_ACL_ACTION_FLAG_REDIRECT_WITH_RAW_PKT          = 1LLU << 37,  /**< [GG.D2.TM] Packet will do redirect with raw info */

    /* following is pbr action flag */
    CTC_ACL_ACTION_FLAG_PBR_TTL_CHECK                  = 1U << 20, /**< [GB.GG] Set PBR ttl-check flag */
    CTC_ACL_ACTION_FLAG_PBR_ICMP_CHECK                 = 1U << 21, /**< [GB.GG] Set PBR icmp-check flag */
    CTC_ACL_ACTION_FLAG_PBR_CPU                        = 1U << 22, /**< [GB.GG.D2.TM] Set PBR copy-to-cpu flag */
    CTC_ACL_ACTION_FLAG_PBR_ECMP                       = 1U << 23, /**< [GB] Set PBR ecmp flag which means use ecmp nexthop directly */
    CTC_ACL_ACTION_FLAG_PBR_FWD                        = 1U << 24, /**< [GB.GG.D2.TM] Set PBR fwd flag */
    CTC_ACL_ACTION_FLAG_PBR_DENY                       = 1U << 25  /**< [GB.GG.D2.TM] Set PBR deny flag */
};
typedef enum ctc_acl_action_flag_e ctc_acl_action_flag_t;

/**
 @brief define acl action structure
*/
struct ctc_acl_action_s
{
    uint64 flag;                /**< [GB.GG.D2.TM] Bitmap of ctc_acl_action_flag_t */

    uint32 nh_id;               /**< [GB.GG.D2.TM] Forward nexthop ID, shared by acl, qos and pbr*/
    uint32 stats_id;            /**< [GB.GG.D2.TM] Stats id*/
    uint16 micro_policer_id;    /**< [GB.GG.D2.TM] Micro flow policer ID */
    uint16 macro_policer_id;    /**< [GB.GG.D2.TM] Macro flow policer ID */
    uint8  trust;               /**< [GB.GG] QoS trust state, CTC_QOS_TRUST_XXX */
    uint8  color;               /**< [GB.GG.D2.TM] Color: green, yellow, or red :CTC_QOS_COLOR_XXX*/
    uint8  priority;            /**< [GB.GG.D2.TM] Priority: 0 - 15 */
    uint8  log_percent;         /**< [GB.GG.D2.TM] Logging percent, CTC_LOG_PERCENT_POWER_NEGATIVE_XX */
    uint8  log_session_id;      /**< [GB.GG.D2.TM] Logging session ID */
    uint8  qos_domain;          /**< [GB.GG] qos domain*/
    uint8  dscp;                /**< [GB.GG.D2.TM] dscp*/

    uint32  assign_port;        /**< [GG] using for CTC_ACL_ACTION_FLAG_ASSIGN_OUTPUT_PORT, means destination Port*/
    uint16  fid;                /**< [GG] fid */
    uint16  vrf_id;             /**< [GG] Vrf ID of the route */
    uint32  metadata;           /**< [GG.D2.TM] Metadata*/

    ctc_acl_packet_strip_t packet_strip; /**< [GG.D2.TM] strip packet for ingress acl*/

    ctc_acl_vlan_edit_t vlan_edit;     /**< [GB.GG.D2.TM] vlan edit, for D2 only support ingress acl */
};
typedef struct ctc_acl_action_s ctc_acl_action_t;

/**
@brief  define acl hash mac field sel structure
*/
struct ctc_acl_hash_mac_field_sel_s
{
    uint8 mac_da     ;  /**< [GG.D2.TM] Select mac da as hash mac key field*/
    uint8 mac_sa     ;  /**< [GG.D2.TM] Select mac sa as hash mac key field*/
    uint8 eth_type   ;  /**< [GG.D2.TM] Select ether type as hash mac key field*/
    uint8 phy_port   ;  /**< [GG.D2.TM] Select phy port as hash mac key field*/
    uint8 logic_port ;  /**< [GG.D2.TM] Select logic port as hash mac key field*/
    uint8 metadata   ;  /**< [GG.D2.TM] Select metadata as hash mac key field*/
    uint8 cos        ;  /**< [GG.D2.TM] Select cos as hash mac key field*/
    uint8 cfi        ;  /**< [GG.D2.TM] Select cfi as hash mac key field*/
    uint8 vlan_id    ;  /**< [GG.D2.TM] Select vlan_id as hash mac key field*/
    uint8 tag_valid  ;  /**< [GG.D2.TM] Select tag valid as hash mac key field*/
};
typedef struct ctc_acl_hash_mac_field_sel_s ctc_acl_hash_mac_field_sel_t;

/**
@brief  define acl hash IPv4 field sel structure
*/
struct ctc_acl_hash_ipv4_field_sel_s
{
    uint8  ip_da       ;  /**< [GG.D2.TM] Select ip da as hash ipv4 key field*/
    uint8  ip_sa       ;  /**< [GG.D2.TM] Select ip sa as hash ipv4 key field*/
    uint8  l4_src_port ;  /**< [GG.D2.TM] Select l4 source port as hash ipv4 key field*/
    uint8  l4_dst_port ;  /**< [GG.D2.TM] Select l4 dest port as hash ipv4 key field*/
    uint8  phy_port    ;  /**< [GG.D2.TM] Select phy port as hash ipv4 key field*/
    uint8  logic_port  ;  /**< [GG.D2.TM] Select logic port as hash ipv4 key field*/
    uint8  metadata    ;  /**< [GG.D2.TM] Select metadata as hash ipv4 key field*/
    uint8  dscp        ;  /**< [GG.D2.TM] Select dscp as hash ipv4 key field*/
    uint8  ecn         ;  /**< [GG.D2.TM] Select ecn da as hash ipv4 key field*/
    uint8  l4_protocol ;  /**< [GG.D2.TM] Select l4 protocol as hash ipv4 key field*/
    uint8  icmp_type   ;  /**< [GG.D2.TM] Select icmp type as hash ipv4 key field*/
    uint8  icmp_code   ;  /**< [GG.D2.TM] Select icmp code as hash ipv4 key field*/
    uint8  vni         ;  /**< [GG.D2.TM] Select vxlan vni as hash ipv4 key field*/
    uint8  gre_key     ;  /**< [GG.D2.TM] Select gre or nvgre key as hash ipv4 key field*/
    uint8  is_route_mac;  /**< [GG.D2.TM] Select is route mac as hash ipv4 key field*/
};
typedef struct ctc_acl_hash_ipv4_field_sel_s ctc_acl_hash_ipv4_field_sel_t;


/**
@brief  define acl hash mpls field sel structure
*/
struct ctc_acl_hash_mpls_field_sel_s
{
    uint8 phy_port          ;  /**< [GG.D2.TM] Select phy port as hash mpls key field*/
    uint8 logic_port        ;  /**< [GG.D2.TM] Select logic port as hash mpls key field*/
    uint8 metadata          ;  /**< [GG.D2.TM] Select metadata as hash mpls key field*/
    uint8 mpls_label_num    ;  /**< [GG.D2.TM] Select mpls label number as hash mpls key field*/
    uint8 mpls_label0_label ;  /**< [GG.D2.TM] Select mpls label0's label as hash mpls key field*/
    uint8 mpls_label0_exp   ;  /**< [GG.D2.TM] Select mpls label0's exp as hash mpls key field*/
    uint8 mpls_label0_s     ;  /**< [GG.D2.TM] Select mpls label0's sbit as hash mpls key field*/
    uint8 mpls_label0_ttl   ;  /**< [GG.D2.TM] Select mpls label0's ttl as hash mpls key field*/
    uint8 mpls_label1_label ;  /**< [GG.D2.TM] Select mpls label1's label as hash mpls key field*/
    uint8 mpls_label1_exp   ;  /**< [GG.D2.TM] Select mpls label1's exp as hash mpls key field*/
    uint8 mpls_label1_s     ;  /**< [GG.D2.TM] Select mpls label1's sbit as hash mpls key field*/
    uint8 mpls_label1_ttl   ;  /**< [GG.D2.TM] Select mpls label1's ttl as hash mpls key field*/
    uint8 mpls_label2_label ;  /**< [GG.D2.TM] Select mpls label2's label as hash mpls key field*/
    uint8 mpls_label2_exp   ;  /**< [GG.D2.TM] Select mpls label2's exp as hash mpls key field*/
    uint8 mpls_label2_s     ;  /**< [GG.D2.TM] Select mpls label2's sbit as hash mpls key field*/
    uint8 mpls_label2_ttl   ;  /**< [GG.D2.TM] Select mpls label2's ttl as hash mpls key field*/
};
typedef struct ctc_acl_hash_mpls_field_sel_s ctc_acl_hash_mpls_field_sel_t;

/**
@brief  define acl hash IPv6 field sel structure
*/
struct ctc_acl_hash_ipv6_field_sel_s
{
    uint8 ip_da       ;  /**< [GG.D2.TM] Select ip da as hash ipv6 key field*/
    uint8 ip_sa       ;  /**< [GG.D2.TM] Select ip sa as hash ipv6 key field*/
    uint8 l4_src_port ;  /**< [GG.D2.TM] Select l4 source port as hash ipv6 key field*/
    uint8 l4_dst_port ;  /**< [GG.D2.TM] Select l4 dest port as hash ipv6 key field*/
    uint8 phy_port    ;  /**< [GG.D2.TM] Select phy port as hash ipv6 key field*/
    uint8 logic_port  ;  /**< [GG.D2.TM] Select logic port as hash ipv6 key field*/
    uint8 metadata    ;  /**< [GG.D2.TM] Select metadata as hash ipv6 key field*/
    uint8 dscp        ;  /**< [GG.D2.TM] Select dscp as hash ipv6 key field*/
    uint8 l4_type     ;  /**< [GG.D2.TM] Select l4 type as hash ipv6 key field*/
    uint8 icmp_type   ;  /**< [GG.D2.TM] Select icmp type as hash ipv6 key field*/
    uint8 icmp_code   ;  /**< [GG.D2.TM] Select icmp code as hash ipv6 key field*/
    uint8  vni        ;  /**< [GG.D2.TM] Select vxlan vni as hash ipv6 key field*/
    uint8  gre_key    ;  /**< [GG.D2.TM] Select gre or nvgre key as hash ipv6 key field*/
};
typedef struct ctc_acl_hash_ipv6_field_sel_s ctc_acl_hash_ipv6_field_sel_t;

/**
@brief  define acl hash L2_L3 field sel structure
*/
struct ctc_acl_hash_l2_l3_field_sel_s
{
    uint8 phy_port            ;  /**< [GG.D2.TM] Select phy port as hash l2 l3 key field*/
    uint8 logic_port          ;  /**< [GG.D2.TM] Select logic port as hash l2 l3 key field*/
    uint8 metadata            ;  /**< [GG.D2.TM] Select metadata as hash l2 l3 key field*/
    uint8 mac_da              ;  /**< [GG.D2.TM] Select mac da as hash l2 l3 key field*/
    uint8 mac_sa              ;  /**< [GG.D2.TM] Select mac sa as hash l2 l3 key field*/
    uint8 stag_cos            ;  /**< [GG.D2.TM] Select stag cos as hash l2 l3 key field*/
    uint8 stag_cfi            ;  /**< [GG.D2.TM] Select stag cfi as hash l2 l3 key field*/
    uint8 stag_vlan           ;  /**< [GG.D2.TM] Select stag vlan as hash l2 l3 key field*/
    uint8 stag_valid          ;  /**< [GG.D2.TM] Select stag valid as hash l2 l3 key field*/
    uint8 ctag_cos            ;  /**< [GG.D2.TM] Select ctag cos as hash l2 l3 key field*/
    uint8 ctag_cfi            ;  /**< [GG.D2.TM] Select ctag cfi as hash l2 l3 key field*/
    uint8 ctag_vlan           ;  /**< [GG.D2.TM] Select ctag vlan as hash l2 l3 key field*/
    uint8 ctag_valid          ;  /**< [GG.D2.TM] Select ctag valid as hash l2 l3 key field*/
    uint8 ip_da              ;   /**< [GG.D2.TM] Select ip da as hash l2 l3 key field*/
    uint8 ip_sa              ;   /**< [GG.D2.TM] Select ip sa as hash l2 l3 key field*/
    uint8 dscp                ;  /**< [GG.D2.TM] Select dscp as hash l2 l3 key field*/
    uint8 ecn                 ;  /**< [GG.D2.TM] Select ecn as hash l2 l3 key field*/
    uint8 ttl                 ;  /**< [GG.D2.TM] Select ttl as hash l2 l3 key field*/
    uint8 eth_type            ;  /**< [GG.D2.TM] Select ether type as hash l2 l3 key field*/
    uint8 l3_type             ;  /**< [GG.D2.TM] Select l3 type as hash l2 l3 key field*/
    uint8 l4_type             ;  /**< [GG.D2.TM] Select l4 type as hash l2 l3 key field*/
    uint8 mpls_label_num      ;  /**< [GG.D2.TM] Select mpls label num as hash l2 l3 key field*/
    uint8 mpls_label0_label   ;  /**< [GG.D2.TM] Select mpls label0's label as hash l2 l3 key field*/
    uint8 mpls_label0_exp     ;  /**< [GG.D2.TM] Select mpls label0's exp as hash l2 l3 key field*/
    uint8 mpls_label0_s       ;  /**< [GG.D2.TM] Select mpls label0's sbit as hash l2 l3 key field*/
    uint8 mpls_label0_ttl     ;  /**< [GG.D2.TM] Select mpls label0's ttl as hash l2 l3 key field*/
    uint8 mpls_label1_label   ;  /**< [GG.D2.TM] Select mpls label1's label as hash l2 l3 key field*/
    uint8 mpls_label1_exp     ;  /**< [GG.D2.TM] Select mpls label1's exp as hash l2 l3 key field*/
    uint8 mpls_label1_s       ;  /**< [GG.D2.TM] Select mpls label1's sbit as hash l2 l3 key field*/
    uint8 mpls_label1_ttl     ;  /**< [GG.D2.TM] Select mpls label1's ttl as hash l2 l3 key field*/
    uint8 mpls_label2_label   ;  /**< [GG.D2.TM] Select mpls label2's label as hash l2 l3 key field*/
    uint8 mpls_label2_exp     ;  /**< [GG.D2.TM] Select mpls label2's exp as hash l2 l3 key field*/
    uint8 mpls_label2_s       ;  /**< [GG.D2.TM] Select mpls label2's sbit as hash l2 l3 key field*/
    uint8 mpls_label2_ttl     ;  /**< [GG.D2.TM] Select mpls label2's ttl as hash l2 l3 key field*/

    uint8 l4_src_port         ;  /**< [GG.D2.TM] Select l4 source port as hash l2 l3 key field*/
    uint8 l4_dst_port         ;  /**< [GG.D2.TM] Select l4 dest port as hash l2 l3 key field*/

    uint8  icmp_type          ;  /**< [GG.D2.TM] Select icmp type as hash l2 l3 key field*/
    uint8  icmp_code          ;  /**< [GG.D2.TM] Select icmp code as hash l2 l3 key field*/
    uint8  vni                ;  /**< [GG.D2.TM] Select vxlan vni as hash l2 l3 key field*/
    uint8  gre_key            ;  /**< [GG.D2.TM] Select gre or nvgre key as hash l2 l3 key field*/
};
typedef struct ctc_acl_hash_l2_l3_field_sel_s ctc_acl_hash_l2_l3_field_sel_t;

/**
@brief  define acl hash field sel structure
*/
struct ctc_acl_hash_field_sel_s
{
    uint8  hash_key_type;                       /**< [GG.D2.TM]refer ctc_acl_key_type_t */
    uint32 field_sel_id;                        /**< [GG.D2.TM] field select id*/

    union
    {
        ctc_acl_hash_mac_field_sel_t   mac;     /**< [GG.D2.TM] hash mac field select */
        ctc_acl_hash_mpls_field_sel_t  mpls;    /**< [GG.D2.TM] hash mpls field select*/
        ctc_acl_hash_ipv4_field_sel_t  ipv4;    /**< [GG.D2.TM] hash ipv4 field select*/
        ctc_acl_hash_ipv6_field_sel_t  ipv6;    /**< [GG.D2.TM] hash ipv6 field select*/
        ctc_acl_hash_l2_l3_field_sel_t l2_l3;   /**< [GG.D2.TM] hash l2 l3 field select*/
    }u;

};
typedef struct ctc_acl_hash_field_sel_s ctc_acl_hash_field_sel_t;

#ifdef __cplusplus
}
#endif

#endif

